Skip to content

Conversation

@sgindeed
Copy link
Contributor

@sgindeed sgindeed commented Oct 8, 2025

  • Implemented the Rabin–Karp string search algorithm in R.
  • Finds all occurrences of a pattern in a given text using rolling hash.
  • Efficient for multiple pattern searches in large texts.
  • Handles case-insensitive input.
  • Prints the starting positions of all matches.
  • Time Complexity: O(n + m) average, O(n*m) worst case.
  • Space Complexity: O(1)

@sgindeed sgindeed requested review from acylam and siriak as code owners October 8, 2025 13:05
@siriak siriak requested a review from Copilot October 8, 2025 20:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the Rabin–Karp string search algorithm in R, which finds all occurrences of a pattern in text using a rolling hash technique for efficient pattern matching.

  • Adds interactive user input for text and pattern
  • Implements rolling hash computation with collision handling
  • Provides case-insensitive pattern matching with position reporting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@siriak
Copy link
Member

siriak commented Oct 8, 2025

Please check the comments, are they accurate?

@sgindeed
Copy link
Contributor Author

sgindeed commented Oct 8, 2025

@siriak i have resolved the issues. please check

@siriak siriak requested a review from Copilot October 8, 2025 21:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak enabled auto-merge (squash) October 8, 2025 21:30
@siriak siriak disabled auto-merge October 8, 2025 21:30
@siriak siriak merged commit e5f6012 into TheAlgorithms:master Oct 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants